{*
* 2007-2011 PrestaShop 
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
*  @author PrestaShop SA <contact@prestashop.com>
*  @copyright  2007-2011 PrestaShop SA
*  @version  Release: $Revision: 8084 $
*  @license    http://opensource.org/licenses/afl-3.0.php  Academic Free License (AFL 3.0)
*  International Registered Trademark & Property of PrestaShop SA
*}

<div id="myregistrations">
	{capture name=path}<a href="{$link->getPageLink('my-account.php', true)}">{l s='My account' mod='groupbuyingreg'}</a><span class="navigation-pipe">{$navigationPipe}</span>{l s='Group buying registration' mod='groupbuyingreg'}{/capture}
	{include file="$tpl_dir./breadcrumb.tpl"}

	<h2>{l s='Group buying registration' mod='groupbuyingreg'}</h2>

	{include file="$tpl_dir./errors.tpl"}
	{if isset($confirm) && $confirm}
		<p class="success"><img src="{$img_dir}icon/ok2.png" alt="" /> {l s = 'Thanks'}</p>
	{/if}
	{if $id_customer|intval neq 0}
		{if $registrations}
		<div id="block-groupbuy" class="block-center">
			<table class="std">
				<thead>
					<tr>
						<th style="width:6%">&nbsp;</th>
						<th style="width:14%">{l s='Company' mod='groupbuyingreg'}</th>
						<th style="width:30%">{l s='Promotion' mod='groupbuyingreg'}</th>
						<th style="width:22%">{l s='Coupon' mod='groupbuyingreg'}</th>
						<th style="width:18%">{l s='Reg date' mod='groupbuyingreg'}</th>
						<th style="width:10%">&nbsp;</th>
					</tr>
				</thead>
				<tbody>
				{foreach from=$registrations item=reg name=i}
					<tr>
						<td>{$smarty.foreach.i.iteration}.</td>
						<td><a href="{$reg.c_url_link}" target="_blank" class="info_link">{$reg.company_name|escape:'htmlall':'UTF-8'}</a></td>
						<td><a href="{$reg.p_url_link}" target="_blank" class="info_link_blue">{$reg.promotion_desc|escape:'htmlall':'UTF-8'}</a></td>
						<td>{$reg.coupon_codes|escape:'htmlall':'UTF-8'}</td>
						<td>{dateFormat date=$reg.reg_date full=1}</td>
						<td class="align_center">
							<a href="{$base_dir_ssl}modules/groupbuyingreg/updateregistration.php?action=edit&id_group_buying_registration={$reg.id_group_buying_registration}"><img src="{$content_dir}modules/groupbuyingreg/img/edit.gif" alt="{l s='Edit' mod='groupbuyingreg'}" title="{l s='Edit' mod='groupbuyingreg'}"/></a><a href="{$base_dir_ssl}modules/groupbuyingreg/updateregistration.php?action=delete&id_group_buying_registration={$reg.id_group_buying_registration}" onClick="return confirm('{l s='Are you sure you want to delete this registration?' mod='groupbuyingreg'}');"><img src="{$content_dir}modules/groupbuyingreg/img/delete.gif" alt="{l s='Delete' mod='groupbuyingreg'}" title="{l s='Delete' mod='groupbuyingreg'}"/></a>
						</td>
					</tr>
				</tbody>
				{/foreach}
			</table>
		</div>
		{else}
			<p class="warning">{l s='You are not registered to any group buying promotions.' mod='groupbuyingreg'}</p>
		{/if}
		<p class="align_center"><a href="{$base_dir_ssl}modules/groupbuyingreg/updateregistration.php" style="margin:auto;" class="button_large">{l s='Register a new promotion' mod='groupbuyingreg'}</a></p>
	{/if}

	<ul class="footer_links">
		<li><a href="{$link->getPageLink('my-account.php', true)}"><img src="{$img_dir}icon/my-account.png" alt="" class="icon" /></a><a href="{$link->getPageLink('my-account.php', true)}">{l s='Back to Your Account' mod='groupbuyingreg'}</a></li>
		<li><a href="{$base_dir}"><img src="{$img_dir}icon/home.png" alt="" class="icon" /></a><a href="{$base_dir}">{l s='Home' mod='groupbuyingreg'}</a></li>
	</ul>
</div>
